<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<fieldset class="layui-elem-field" th:fragment="provident_fund_purchase_model" th:case="'provident_fund_purchase_model'">
    <legend th:text="${type == 'create' ? '公积金购买情况 - 信息新增' : '公积金购买情况 - 信息更新'}"></legend>
    <div class="layui-field-box">
        <!--post方式提交-->
        <form class="layui-form" th:method="${type == 'create' ? 'get' : 'post'}" th:action="@{${req_url}}">
            <input type="hidden" name="pfpId" th:if="${providentFundPurchase != null}" th:value="${providentFundPurchase.pfpId}">
            <div class="layui-form-item">
                <label class="layui-form-label">购买时间</label>
                <div class="layui-input-block">
                    <input type="date"  name="pfpStartTime" th:value="${providentFundPurchase != null} ? ${#dates.format(providentFundPurchase.pfpStartTime, 'yyyy-MM-dd')}" required  lay-verify="required" placeholder="请输入公积金购买时间" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">停买时间</label>
                <div class="layui-input-block">
                    <input type="date"  name="pfpEndTime" th:value="${providentFundPurchase != null} ? ${#dates.format(providentFundPurchase.pfpEndTime, 'yyyy-MM-dd')}" required  lay-verify="required" placeholder="请输入公积金停买时间" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">员工</label>
                <div class="layui-input-block">
                    <select name="empId" required  lay-verify="required" placeholder="请选择员工">
                        <option th:each="employee:${employees}" th:selected="${providentFundPurchase != null && providentFundPurchase.empId == employee.empId} ? 'selected'" th:value="${employee.empId}">[[${employee.empName}]]</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo" type="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</fieldset>
</body>
</html>